<?php

$originData = [
    'grant_type' => 'client_credentials',
    'client_id' => 'yashili',
    'client_secret' => 'qc976eke',
];
$publicKey = file_get_contents('./public.cert');
echo $publicKey . "\n";
// 使用公钥加密
openssl_public_encrypt(json_encode($originData), $encrypted, $publicKey);
echo json_encode(['payload' => base64_encode($encrypted)]);